/*
 * @Author: your name
 * @Date: 2021-06-07 08:53:21
 * @LastEditTime: 2021-06-15 19:39:52
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \CPP\UDP\user.h
 */
#pragma once

#include<iostream>
#include<string>
using namespace std;

//定义用户类型
#define USERTYPE int
#define CONSUMER 1 //消费者
#define MERCHANT 2 //商家

//定义购物车最大数目
#define MAX_CART_COMMODITY_NUM 40

class User
{
private:
    //账户名
	string m_Username;
	//账户密码
	string m_Password;
	//余额
	double m_Balance;
	//账户类型
	int m_type;
 	//购物车商品种类数
	int m_commodity_num;
	//购物车商品下标数组
	int commodity_index_array[MAX_CART_COMMODITY_NUM];
	//对应下标的商品数目
	int commodity_index_num_array[MAX_CART_COMMODITY_NUM];

public:
    //构造函数
    
    //析构函数
    virtual ~User();

    //set 接口
    void set_Name(const string& name);
	void set_Passwd(const string& passwd);
	void set_Type(int type);
    void set_Balance(double balance);
    void set_Commodity_Num(int commodity_num);
	void set_Commodity_Index_Array(int* array,int length);
	void set_Commodity_Index_Num_Array(int* array,int length);
    
    //get 接口
    string get_Name();
	string get_Passwd();
	int get_Type();
    double get_Balance();
    int get_Commodity_Num();
	int* get_Commodity_Index_Array();
	int* get_Commodity_Index_Num_Array();

    //纯虚函数,子类实现
    virtual USERTYPE getUserType() = 0;


};
